Repository navigation
London | 26-Sep-ITP | Frumentius Tesfay | Sprint 3 | Coursework/sprint 3 dead code - #1772
Frumentius-Rev wants to merge 7 commits into
Conversation
|
Thank you for this PR. Great job cleaning up the dead code in Exercises 1 and 2. Just one tiny optional cleanup in dead-code/exercise-1.js: testName is initialized to "Jerry" before immediately being reassigned to "Aman", so you can remove the "Jerry" initialization (e.g., just declare const testName = "Aman";). Otherwise, looks great and ready to go for approval. |
|
Thank you for your clear feedback. I have removed it as suggested. |
iscmiguelsamaniego
left a comment
There was a problem hiding this comment.
Great job across backend, frontend, and tests today! Always remove unreachable code (like hardcoded returns), manage async errors, avoid duplicate declarations, and write robust tests. Being far from home is tough, but your progress is amazing. Keep pushing forward!
There was a problem hiding this comment.
Being far from home is tough, but every line of code you write is a step closer to building the future you deserve—keep going!
- What happens in JavaScript when you use
letto declaretestNametwice in the same scope? - Inside
sayHello, what happens to any code placed after thereturnstatement, and isgreetingStrused anywhere else in that function?
There was a problem hiding this comment.
To help refine it:
Did you notice any duplicate declarations for petsStartingWithH in the code?
Are capitalisedPets and logPets used anywhere to achieve the final countedPetsStartingWithH output?
Being far from home is tough, but your persistence and focus are building a brilliant path forward—keep pushing!
There was a problem hiding this comment.
Thank you so much for sharing your code—it's wonderful to see the loop and counter logic set up so cleanly!
If we look closely at the very beginning of the function, what do you think happens when execution encounters return 5 right away? How might that affect test cases, like an empty string, that expect a count of 0?
|
The PR cleans up dead code across two exercises and implements countChar with accompanying unit tests. The changes are concise, readable, and aligned with the repository's existing test conventions. Ready to merge. |
|
@valentina-starr1 @iscmiguelsamaniego - who is leading the review here? Normally in our code review flow we use labels to indicate the status of the review. This is used in our Portal to track completion of work. Please can you label this work accordingly if it's "complete" Note: @valentina-starr1 you have used language like "Ready to merge" and "go for approval" - we don't merge trainee work into our repositories. We use labels only to indicate completion/need for more work on the PR, and the completed work sits in a open PR, we don't specifically "approve" the PR for merge. Happy to chat about this - on Slack or here |
Learners, PR Template
Self checklist
Task code
CYF-1066
Changelist
Removed redundant, unused, and unreachable code from Exercises 1 and 2 while preserving the existing functionality.